﻿using System;
using Budget.Core.DomainModel;
using Budget.Core.Specifications.Base;

namespace Budget.Core.Specifications
{
    public static class OutcomeSpecifications
    {
        public static ISpecification<OutcomeOrder> ByDate(DateTime date)
        {
            return new QuerySpecification<OutcomeOrder>(o => o.CreationDate.Date == date.Date);
        }

        public static ISpecification<OutcomeOrder> YoungerThanDate(DateTime date)
        {
            return new QuerySpecification<OutcomeOrder>(o => o.CreationDate.Date >= date.Date);
        }

        public static ISpecification<OutcomeOrder> Range(DateTime start, DateTime end)
        {
            return new QuerySpecification<OutcomeOrder>(o => o.CreationDate.Date >= start.Date && o.CreationDate.Date <= end.Date);
        }
    }
}